import { IsString, IsInt, IsNumberString } from 'class-validator';
import { Transform } from "class-transformer";
import { ApiProperty } from '@nestjs/swagger';

export class CreateTestDTO {
   @IsString()
   @ApiProperty({description: 'test名称', })
   readonly name: string;
   
   @IsString()
   @ApiProperty({description: 'test描述', })
   readonly description: string;
   
   @IsString()
   @ApiProperty({description: '头像名称', })
   readonly filename: string;
   
   @IsInt()
   @Transform(value => Number(value))
   @ApiProperty({description: '头像路径', })
   readonly views: number;
   
   @IsInt()
   @Transform(value => Number(value))
   @ApiProperty({description: '是否可用', })
   readonly isPublished: number;
}